package com.app.designpatternslearn.behavior.visitorpattern.code

class Store {

    private val shops = mutableListOf<Shop>()

    fun attach(shop: Shop) {
        shops.add(shop)
    }

    fun detach(shop: Shop) {
        shops.remove(shop)
    }

    fun accept(visitor: Visitor) {
        for (item in shops) {
            item.accept(visitor)
        }
    }

}